package cn.echo.ecc.enums;

import lombok.Getter;

@Getter
public enum  GlobalExceptionCode {
    SUCCESS("成功","0"),
    FAIL("失败","-1"),
    PARAM_IS_NOT_BULL("参数不能为空","1001"),
    FREQUENT_OPERATION_ERROR("操作频繁，请稍后重试","1002"),
    SERVICE_ERROR("feign接口服务调用异常，请稍后重试！","1003"),

    // common通信服务200X
    PHONE_FORMAT_ERROR("电话号码格式不正确","2001"),
    OUT_TIME_CODE_ERROR("验证码过期，请重新获取","2002"),
    CODE_ERROR("验证码错误，请重新输入","2003"),
    BLACKLIST_EXISTED_ERROR("已存在，不能重复添加到黑名单","2004"),
    DISABLED_ERROR("您已经被禁⽤发送短信验证码，请联系管理员","2005"),

    // user服务300X
    USER_EXISTED_ERROR("用户已注册","3001"),
    USER_SAVE_ERROR("用户保存失败","3002"),
    USER_NOT_EXISTED_ERROR("用户不存在","3002"),

    // course服务400X
    COURSE_EXISTED_ERROR("课程已存在","4001"),
    COURSE_IS_NULL_ERROR("课程不存在","4002"),
    COURSE_IS_ONLINE_ERROR("课程已上架","4003"),
    COURSE_TYPE_IS_NULL_ERROR("课程类型为空","4004"),
    COURSE_TYPE_PATH_IS_NULL_ERROR("路径为空","4005"),
    COURSE_IS_OFFLINE_ERROR("课程已下架","4006"),
    COURSE_COLLECT_ERROR("课程收藏为空，发送消息失败","4007"),
    COURSE_MARKET_IS_NULL_ERROR("课程销售表信息不存在","4008"),
    COURSE_USER_LEARN_IS_NULL_ERROR("如需观看，请购买！","4009"),
    COURSE_OUT_TIME_ERROR("课程已过期，请重新购买！","4010"),
    COURSE_REQUEST_PURCHASE_ERROR("请重新请求购买！","4011"),
    COURSE_INFO_ERROR("课程订单详情信息查询异常！","4012"),

    // media服务500X
    MEDIA_FILE_IS_NULL_ERROR("课程视频不存在","5001"),

    // order服务600X
    ORDER_TOKEN_NON_EXISTENT_ERROR("防重Token不存在","6001"),
    ORDER_TOKEN__ERROR("防重Token不正确","6002"),
    SEND_TX_MESSAGE_ERROR("发送事务消息失败","6003"),

    // pay服务700X
    PAY_ORDER_NOT_EXIST_ERROR("支付单不存在","7001"),
    PAY_ORDER_STATE_ERROR("支付单已完成，状态已修改","7002"),
    ALIPAY_ERROR("支付宝支付调用失败","7003"),

    // kill服务800X
    KILL_ACTIVITY_IS_NULL_ERROR("秒杀活动不存在","8001"),
    KILL_ACTIVITY_STATE_ERROR("秒杀活动已发布","8002"),
    KILL_COURSE_IS_NULL_ERROR("秒杀课程不存在","8003"),
    KILL_IS_CANCEL_ERROR("秒杀活动已取消","8004"),
    KILL_ORDER_ERROR("秒杀预创订单已存在","8005"),
    KILL_ORDER_NO_ERROR("秒杀预创订单不存在","8006"),
    KILL_ERROR("秒杀失败","8007"),

    // uaa服务900X
    CLIENT_ERROR("客户端参数不能为空","9001"),
    ;

    private String message;

    private String code;

    GlobalExceptionCode(String message, String code) {
        this.message = message;
        this.code = code;
    }
}

